package com.xinqi.modules.prepare.prepare.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xinqi.common.base.annotations.Describe;
import com.xinqi.common.base.enums.BaseEnum;
import lombok.Getter;

/**
 * 文件类型
 * <p>
 * 文件类型，FOLDER:文件夹；FILE:文件；
 * </p>
 *
 * @author linkai
 * @date 2023/03/19
 */
@Describe("文件类型")
public enum PrepareFileTypeEnum implements BaseEnum {

    FOLDER("FOLDER", "文件夹"),
    FILE("FILE", "文件"),
    ;

    @Getter(onMethod_ = {@JsonValue})
    private final String code;

    @Getter
    private final String describe;

    PrepareFileTypeEnum(String code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static PrepareFileTypeEnum of(String code) {
        return BaseEnum.of(PrepareFileTypeEnum.class, code);
    }

}
